package com.shynin.comtroller;

import com.shynin.common.bean.dto.UserDTO;
import com.shynin.service.IUserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Created by Shynin on 2019/1/29.
 */
@RestController
@RequestMapping("/feign")
public class FeignController {

    @Resource
    private IUserService iUserService;

    @GetMapping("/user/{id}")
    public UserDTO fetchUser(@PathVariable("id")Long id) {
        return iUserService.findById(id);
    }
}
